﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kang.DbDoc.Models
{
    public class ColumnModel : ObservableObject
    {
        private string _name;
        /// <summary>
        /// 列名
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                SetProperty(ref _name, value);
            }
        }

        private string _type;
        /// <summary>
        /// 列类型
        /// </summary>
        public string Type
        {
            get
            {
                return _type;
            }
            set
            {
                SetProperty(ref _type, value);
            }
        }

        private string _comment;
        /// <summary>
        /// 列注解
        /// </summary>
        public string Comment
        {
            get
            {
                return _comment;
            }
            set
            {
                SetProperty(ref _comment, value);
            }
        }

        private long? _length;
        /// <summary>
        /// 字段长度
        /// </summary>
        public long? Length
        {
            get
            {
                return _length;
            }
            set
            {
                SetProperty(ref _length, value);
            }
        }

        private int? _scale;
        /// <summary>
        /// 字段小数位数
        /// </summary>
        public int? Scale
        {
            get
            {
                return _scale;
            }
            set
            {
                SetProperty(ref _scale, value);
            }
        }

        private string _keyType;
        /// <summary>
        /// 键类型
        /// </summary>
        public string KeyType
        {
            get
            {
                return _keyType;
            }
            set
            {
                SetProperty(ref _keyType, value);
            }
        }

        private string _extra;
        /// <summary>
        /// 是否自增
        /// </summary>
        public string Extra
        {
            get
            {
                return _extra;
            }
            set
            {
                SetProperty(ref _extra, value);
            }
        }

        private bool _isAutoIncrement;
        /// <summary>
        /// 是否自增
        /// </summary>
        public bool IsAutoIncrement
        {
            get
            {
                return _isAutoIncrement;
            }
            set
            {
                SetProperty(ref _isAutoIncrement, value);
            }
        }

        private bool _isNull;
        /// <summary>
        /// 是否为NULL
        /// </summary>
        public bool IsNull
        {
            get
            {
                return _isNull;
            }
            set
            {
                SetProperty(ref _isNull, value);
            }
        }

        private string _default;
        /// <summary>
        /// 是否为NULL
        /// </summary>
        public string Default
        {
            get
            {
                return _default;
            }
            set
            {
                SetProperty(ref _default, value);
            }
        }
    }
}
